import $http from "@/plugs/axios";

export const getCurdlist = (data:any) => {
  return $http.get("api/user/list",{params:data});
};

export const getCurdlist1 = () => {
  return $http.get("api/user/listAll",);
};

export const adduser = (data:any) => {
  return $http.post("api/user/add",data);
};

export const adduser1 = (data:any) => {
  return $http.post("api/open/reg",data);
};

export const getRoles = (data?:any) => {
  return $http.get("api/role/listAll",);
};

export const getRole = (data:any) => {
  return $http.get("api/role/list",{params:data});
};

export const exportUser = (...p) => {
  return $http.get("api/user/export",...p);
};

export const delUser = (data:any) => {
  return $http.post("api/user/delete",{id: data.id ? data.id : data.taskId});
};

export const updateUser = (data:any) => {
  return $http.post("api/user/update",data);
};


export const getMenus = () => {
  return $http.get("api/menu/list");
};


export const getMenulist = () => {
  return $http.get("api/menu/lists");
};


export const getRoleMenus = (id:string) => {
  return $http.get("api/role/menu/"+id);
};


export const editRoleMenus = (id:number,data:any) => {
  return $http.post("api/role/menu/"+id,data);
};


export const getOrganization = () => {
  return $http.get("api/organization/list");
};

export const getOrganizationid = (id:string) => {
  return $http.get("api/organization/"+id);
};

export const GetuserList = () => {
  return $http.get("api/organization/userList");
};

export const editosam = (id:number,data:any) => {
  return $http.post("api/organization/eidt/"+id,data);
};

export const setman = (data:any) => {
  return $http.post("api/organization/setMan",data);
};

export const delman = (id:string) => {
  return $http.delete("api/organization/man/"+id);
};


export const qjpost = (data:any) => {
  return $http.post("api/task/add/5",data);
};

export const qjpost1 = (data:any) => {
  return $http.post("api/task/flowadd/5",data);
};


export const getmytask1 = (data?:any) => {
  return $http.get("api/task/mytaskflow",{params:data});
};


export const bxpost = (data:any) => {
  return $http.post("api/task/add/6",data);
};

export const getmytask = (data?:any) => {
  return $http.get("api/task/mytask",{params:data});
};

export const delmytask = (data:any) => {
  return $http.post("api/task/mytask/delete",{id: data.id ? data.id : data.taskId});
};

export const delmytask1 = (data:any) => {
  return $http.post("api/task/mytask/deletea",{id: data.processInstanceId });
};

export const gettaskdl= (id:string) => {
  return $http.get("api/task/deail/"+id);
};

export const gettaskdlf= (id:string) => {
  return $http.get("api/task/deailf/"+id);
};
export const gettip= (id:string) => {
  return $http.get("api/task/pic/"+id);
};

export const myHandleTask = (data?:any) => {
  return $http.get("api/task/myHandleTask",{params:data});
};

export const myHandleTaskf = (data?:any) => {
  return $http.get("api/task/myfHandleTask",{params:data});
};

export const taskOk = (id:number,data:any) => {

  return $http.post("api/task/taskOk/"+id,data);
};

export const taskOkf = (id:number,data:any) => {

  return $http.post("api/task/ftaskOk/"+id,data);
};

export const taskNof = (id:number,data:any) => {

  return $http.post("api/task/ftaskNo/"+id,data);
};